// $ANTLR 3.4 C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g 2012-11-28 16:14:53

package PL.prac10;


import org.antlr.runtime.*;
import java.util.Stack;
import java.util.List;
import java.util.ArrayList;

import org.antlr.runtime.tree.*;


@SuppressWarnings({"all", "warnings", "unchecked"})
public class CalcParser extends Parser {
    public static final String[] tokenNames = new String[] {
        "<invalid>", "<EOR>", "<DOWN>", "<UP>", "APARENTESIS", "BLANCO", "CPARENTESIS", "DIGITO", "DISTINTO", "ENTRE", "IDENT", "IGUAL", "LETRA", "MAS", "MAYOR", "MENOR", "MENOS", "NUMERO", "OP_LOGICOS", "POR", "PUNTO", "SEPARADOR", "LISTA_INST"
    };

    public static final int EOF=-1;
    public static final int APARENTESIS=4;
    public static final int BLANCO=5;
    public static final int CPARENTESIS=6;
    public static final int DIGITO=7;
    public static final int DISTINTO=8;
    public static final int ENTRE=9;
    public static final int IDENT=10;
    public static final int IGUAL=11;
    public static final int LETRA=12;
    public static final int MAS=13;
    public static final int MAYOR=14;
    public static final int MENOR=15;
    public static final int MENOS=16;
    public static final int NUMERO=17;
    public static final int OP_LOGICOS=18;
    public static final int POR=19;
    public static final int PUNTO=20;
    public static final int SEPARADOR=21;
    public static final int LISTA_INST=22;

    // delegates
    public Parser[] getDelegates() {
        return new Parser[] {};
    }

    // delegators


    public CalcParser(TokenStream input) {
        this(input, new RecognizerSharedState());
    }
    public CalcParser(TokenStream input, RecognizerSharedState state) {
        super(input, state);
    }

protected TreeAdaptor adaptor = new CommonTreeAdaptor();

public void setTreeAdaptor(TreeAdaptor adaptor) {
    this.adaptor = adaptor;
}
public TreeAdaptor getTreeAdaptor() {
    return adaptor;
}
    public String[] getTokenNames() { return CalcParser.tokenNames; }
    public String getGrammarFileName() { return "C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g"; }


    public static class entrada_return extends ParserRuleReturnScope {
        MiArbol tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "entrada"
    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:21:1: entrada : ( instrucciones )* EOF -> ^( LISTA_INST ( instrucciones )* ) ;
    public final CalcParser.entrada_return entrada() throws RecognitionException {
        CalcParser.entrada_return retval = new CalcParser.entrada_return();
        retval.start = input.LT(1);


        MiArbol root_0 = null;

        Token EOF2=null;
        CalcParser.instrucciones_return instrucciones1 =null;


        MiArbol EOF2_tree=null;
        RewriteRuleTokenStream stream_EOF=new RewriteRuleTokenStream(adaptor,"token EOF");
        RewriteRuleSubtreeStream stream_instrucciones=new RewriteRuleSubtreeStream(adaptor,"rule instrucciones");
        try {
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:21:8: ( ( instrucciones )* EOF -> ^( LISTA_INST ( instrucciones )* ) )
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:21:10: ( instrucciones )* EOF
            {
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:21:10: ( instrucciones )*
            loop1:
            do {
                int alt1=2;
                int LA1_0 = input.LA(1);

                if ( (LA1_0==APARENTESIS||LA1_0==IDENT||LA1_0==NUMERO) ) {
                    alt1=1;
                }


                switch (alt1) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:21:10: instrucciones
            	    {
            	    pushFollow(FOLLOW_instrucciones_in_entrada77);
            	    instrucciones1=instrucciones();

            	    state._fsp--;

            	    stream_instrucciones.add(instrucciones1.getTree());

            	    }
            	    break;

            	default :
            	    break loop1;
                }
            } while (true);


            EOF2=(Token)match(input,EOF,FOLLOW_EOF_in_entrada80);  
            stream_EOF.add(EOF2);


            // AST REWRITE
            // elements: instrucciones
            // token labels: 
            // rule labels: retval
            // token list labels: 
            // rule list labels: 
            // wildcard labels: 
            retval.tree = root_0;
            RewriteRuleSubtreeStream stream_retval=new RewriteRuleSubtreeStream(adaptor,"rule retval",retval!=null?retval.tree:null);

            root_0 = (MiArbol)adaptor.nil();
            // 21:29: -> ^( LISTA_INST ( instrucciones )* )
            {
                // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:21:32: ^( LISTA_INST ( instrucciones )* )
                {
                MiArbol root_1 = (MiArbol)adaptor.nil();
                root_1 = (MiArbol)adaptor.becomeRoot(
                (MiArbol)adaptor.create(LISTA_INST, "LISTA_INST")
                , root_1);

                // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:21:45: ( instrucciones )*
                while ( stream_instrucciones.hasNext() ) {
                    adaptor.addChild(root_1, stream_instrucciones.nextTree());

                }
                stream_instrucciones.reset();

                adaptor.addChild(root_0, root_1);
                }

            }


            retval.tree = root_0;

            }

            retval.stop = input.LT(-1);


            retval.tree = (MiArbol)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException rre) {
          throw rre;}
         
        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "entrada"


    public static class instrucciones_return extends ParserRuleReturnScope {
        MiArbol tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "instrucciones"
    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:22:1: instrucciones : ( operadores | asignacion ) SEPARADOR !;
    public final CalcParser.instrucciones_return instrucciones() throws RecognitionException {
        CalcParser.instrucciones_return retval = new CalcParser.instrucciones_return();
        retval.start = input.LT(1);


        MiArbol root_0 = null;

        Token SEPARADOR5=null;
        CalcParser.operadores_return operadores3 =null;

        CalcParser.asignacion_return asignacion4 =null;


        MiArbol SEPARADOR5_tree=null;

        try {
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:22:14: ( ( operadores | asignacion ) SEPARADOR !)
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:22:16: ( operadores | asignacion ) SEPARADOR !
            {
            root_0 = (MiArbol)adaptor.nil();


            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:22:16: ( operadores | asignacion )
            int alt2=2;
            int LA2_0 = input.LA(1);

            if ( (LA2_0==APARENTESIS||LA2_0==NUMERO) ) {
                alt2=1;
            }
            else if ( (LA2_0==IDENT) ) {
                int LA2_2 = input.LA(2);

                if ( (LA2_2==IGUAL) ) {
                    alt2=2;
                }
                else if ( (LA2_2==ENTRE||LA2_2==MAS||LA2_2==MENOS||(LA2_2 >= OP_LOGICOS && LA2_2 <= POR)||LA2_2==SEPARADOR) ) {
                    alt2=1;
                }
                else {
                    NoViableAltException nvae =
                        new NoViableAltException("", 2, 2, input);

                    throw nvae;

                }
            }
            else {
                NoViableAltException nvae =
                    new NoViableAltException("", 2, 0, input);

                throw nvae;

            }
            switch (alt2) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:22:17: operadores
                    {
                    pushFollow(FOLLOW_operadores_in_instrucciones98);
                    operadores3=operadores();

                    state._fsp--;

                    adaptor.addChild(root_0, operadores3.getTree());

                    }
                    break;
                case 2 :
                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:22:28: asignacion
                    {
                    pushFollow(FOLLOW_asignacion_in_instrucciones100);
                    asignacion4=asignacion();

                    state._fsp--;

                    adaptor.addChild(root_0, asignacion4.getTree());

                    }
                    break;

            }


            SEPARADOR5=(Token)match(input,SEPARADOR,FOLLOW_SEPARADOR_in_instrucciones103); 

            }

            retval.stop = input.LT(-1);


            retval.tree = (MiArbol)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException rre) {
          throw rre;}
         
        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "instrucciones"


    public static class operadores_return extends ParserRuleReturnScope {
        MiArbol tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "operadores"
    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:23:1: operadores : expresion ( OP_LOGICOS expresion )* ;
    public final CalcParser.operadores_return operadores() throws RecognitionException {
        CalcParser.operadores_return retval = new CalcParser.operadores_return();
        retval.start = input.LT(1);


        MiArbol root_0 = null;

        Token OP_LOGICOS7=null;
        CalcParser.expresion_return expresion6 =null;

        CalcParser.expresion_return expresion8 =null;


        MiArbol OP_LOGICOS7_tree=null;

        try {
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:23:11: ( expresion ( OP_LOGICOS expresion )* )
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:23:13: expresion ( OP_LOGICOS expresion )*
            {
            root_0 = (MiArbol)adaptor.nil();


            pushFollow(FOLLOW_expresion_in_operadores110);
            expresion6=expresion();

            state._fsp--;

            adaptor.addChild(root_0, expresion6.getTree());

            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:23:23: ( OP_LOGICOS expresion )*
            loop3:
            do {
                int alt3=2;
                int LA3_0 = input.LA(1);

                if ( (LA3_0==OP_LOGICOS) ) {
                    alt3=1;
                }


                switch (alt3) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:23:24: OP_LOGICOS expresion
            	    {
            	    OP_LOGICOS7=(Token)match(input,OP_LOGICOS,FOLLOW_OP_LOGICOS_in_operadores113); 
            	    OP_LOGICOS7_tree = 
            	    (MiArbol)adaptor.create(OP_LOGICOS7)
            	    ;
            	    adaptor.addChild(root_0, OP_LOGICOS7_tree);


            	    pushFollow(FOLLOW_expresion_in_operadores115);
            	    expresion8=expresion();

            	    state._fsp--;

            	    adaptor.addChild(root_0, expresion8.getTree());

            	    }
            	    break;

            	default :
            	    break loop3;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (MiArbol)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException rre) {
          throw rre;}
         
        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "operadores"


    public static class asignacion_return extends ParserRuleReturnScope {
        MiArbol tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "asignacion"
    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:24:1: asignacion : IDENT IGUAL ^ expresion ;
    public final CalcParser.asignacion_return asignacion() throws RecognitionException {
        CalcParser.asignacion_return retval = new CalcParser.asignacion_return();
        retval.start = input.LT(1);


        MiArbol root_0 = null;

        Token IDENT9=null;
        Token IGUAL10=null;
        CalcParser.expresion_return expresion11 =null;


        MiArbol IDENT9_tree=null;
        MiArbol IGUAL10_tree=null;

        try {
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:24:11: ( IDENT IGUAL ^ expresion )
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:24:13: IDENT IGUAL ^ expresion
            {
            root_0 = (MiArbol)adaptor.nil();


            IDENT9=(Token)match(input,IDENT,FOLLOW_IDENT_in_asignacion123); 
            IDENT9_tree = 
            (MiArbol)adaptor.create(IDENT9)
            ;
            adaptor.addChild(root_0, IDENT9_tree);


            IGUAL10=(Token)match(input,IGUAL,FOLLOW_IGUAL_in_asignacion125); 
            IGUAL10_tree = 
            (MiArbol)adaptor.create(IGUAL10)
            ;
            root_0 = (MiArbol)adaptor.becomeRoot(IGUAL10_tree, root_0);


            pushFollow(FOLLOW_expresion_in_asignacion128);
            expresion11=expresion();

            state._fsp--;

            adaptor.addChild(root_0, expresion11.getTree());

            }

            retval.stop = input.LT(-1);


            retval.tree = (MiArbol)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException rre) {
          throw rre;}
         
        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "asignacion"


    public static class expresion_return extends ParserRuleReturnScope {
        MiArbol tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "expresion"
    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:25:1: expresion : exp_mult ( ( MAS ^| MENOS ^) exp_mult )* ;
    public final CalcParser.expresion_return expresion() throws RecognitionException {
        CalcParser.expresion_return retval = new CalcParser.expresion_return();
        retval.start = input.LT(1);


        MiArbol root_0 = null;

        Token MAS13=null;
        Token MENOS14=null;
        CalcParser.exp_mult_return exp_mult12 =null;

        CalcParser.exp_mult_return exp_mult15 =null;


        MiArbol MAS13_tree=null;
        MiArbol MENOS14_tree=null;

        try {
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:25:10: ( exp_mult ( ( MAS ^| MENOS ^) exp_mult )* )
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:25:12: exp_mult ( ( MAS ^| MENOS ^) exp_mult )*
            {
            root_0 = (MiArbol)adaptor.nil();


            pushFollow(FOLLOW_exp_mult_in_expresion134);
            exp_mult12=exp_mult();

            state._fsp--;

            adaptor.addChild(root_0, exp_mult12.getTree());

            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:25:21: ( ( MAS ^| MENOS ^) exp_mult )*
            loop5:
            do {
                int alt5=2;
                int LA5_0 = input.LA(1);

                if ( (LA5_0==MAS||LA5_0==MENOS) ) {
                    alt5=1;
                }


                switch (alt5) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:25:22: ( MAS ^| MENOS ^) exp_mult
            	    {
            	    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:25:22: ( MAS ^| MENOS ^)
            	    int alt4=2;
            	    int LA4_0 = input.LA(1);

            	    if ( (LA4_0==MAS) ) {
            	        alt4=1;
            	    }
            	    else if ( (LA4_0==MENOS) ) {
            	        alt4=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 4, 0, input);

            	        throw nvae;

            	    }
            	    switch (alt4) {
            	        case 1 :
            	            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:25:23: MAS ^
            	            {
            	            MAS13=(Token)match(input,MAS,FOLLOW_MAS_in_expresion138); 
            	            MAS13_tree = 
            	            (MiArbol)adaptor.create(MAS13)
            	            ;
            	            root_0 = (MiArbol)adaptor.becomeRoot(MAS13_tree, root_0);


            	            }
            	            break;
            	        case 2 :
            	            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:25:28: MENOS ^
            	            {
            	            MENOS14=(Token)match(input,MENOS,FOLLOW_MENOS_in_expresion141); 
            	            MENOS14_tree = 
            	            (MiArbol)adaptor.create(MENOS14)
            	            ;
            	            root_0 = (MiArbol)adaptor.becomeRoot(MENOS14_tree, root_0);


            	            }
            	            break;

            	    }


            	    pushFollow(FOLLOW_exp_mult_in_expresion145);
            	    exp_mult15=exp_mult();

            	    state._fsp--;

            	    adaptor.addChild(root_0, exp_mult15.getTree());

            	    }
            	    break;

            	default :
            	    break loop5;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (MiArbol)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException rre) {
          throw rre;}
         
        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "expresion"


    public static class exp_mult_return extends ParserRuleReturnScope {
        MiArbol tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "exp_mult"
    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:26:1: exp_mult : exp_base ( ( POR ^| ENTRE ^) exp_base )* ;
    public final CalcParser.exp_mult_return exp_mult() throws RecognitionException {
        CalcParser.exp_mult_return retval = new CalcParser.exp_mult_return();
        retval.start = input.LT(1);


        MiArbol root_0 = null;

        Token POR17=null;
        Token ENTRE18=null;
        CalcParser.exp_base_return exp_base16 =null;

        CalcParser.exp_base_return exp_base19 =null;


        MiArbol POR17_tree=null;
        MiArbol ENTRE18_tree=null;

        try {
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:26:9: ( exp_base ( ( POR ^| ENTRE ^) exp_base )* )
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:26:11: exp_base ( ( POR ^| ENTRE ^) exp_base )*
            {
            root_0 = (MiArbol)adaptor.nil();


            pushFollow(FOLLOW_exp_base_in_exp_mult153);
            exp_base16=exp_base();

            state._fsp--;

            adaptor.addChild(root_0, exp_base16.getTree());

            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:26:20: ( ( POR ^| ENTRE ^) exp_base )*
            loop7:
            do {
                int alt7=2;
                int LA7_0 = input.LA(1);

                if ( (LA7_0==ENTRE||LA7_0==POR) ) {
                    alt7=1;
                }


                switch (alt7) {
            	case 1 :
            	    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:26:21: ( POR ^| ENTRE ^) exp_base
            	    {
            	    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:26:21: ( POR ^| ENTRE ^)
            	    int alt6=2;
            	    int LA6_0 = input.LA(1);

            	    if ( (LA6_0==POR) ) {
            	        alt6=1;
            	    }
            	    else if ( (LA6_0==ENTRE) ) {
            	        alt6=2;
            	    }
            	    else {
            	        NoViableAltException nvae =
            	            new NoViableAltException("", 6, 0, input);

            	        throw nvae;

            	    }
            	    switch (alt6) {
            	        case 1 :
            	            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:26:22: POR ^
            	            {
            	            POR17=(Token)match(input,POR,FOLLOW_POR_in_exp_mult157); 
            	            POR17_tree = 
            	            (MiArbol)adaptor.create(POR17)
            	            ;
            	            root_0 = (MiArbol)adaptor.becomeRoot(POR17_tree, root_0);


            	            }
            	            break;
            	        case 2 :
            	            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:26:27: ENTRE ^
            	            {
            	            ENTRE18=(Token)match(input,ENTRE,FOLLOW_ENTRE_in_exp_mult160); 
            	            ENTRE18_tree = 
            	            (MiArbol)adaptor.create(ENTRE18)
            	            ;
            	            root_0 = (MiArbol)adaptor.becomeRoot(ENTRE18_tree, root_0);


            	            }
            	            break;

            	    }


            	    pushFollow(FOLLOW_exp_base_in_exp_mult163);
            	    exp_base19=exp_base();

            	    state._fsp--;

            	    adaptor.addChild(root_0, exp_base19.getTree());

            	    }
            	    break;

            	default :
            	    break loop7;
                }
            } while (true);


            }

            retval.stop = input.LT(-1);


            retval.tree = (MiArbol)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException rre) {
          throw rre;}
         
        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "exp_mult"


    public static class exp_base_return extends ParserRuleReturnScope {
        MiArbol tree;
        public Object getTree() { return tree; }
    };


    // $ANTLR start "exp_base"
    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:1: exp_base : ( ( NUMERO ) | ( IDENT ) | ( APARENTESIS ! expresion CPARENTESIS !) );
    public final CalcParser.exp_base_return exp_base() throws RecognitionException {
        CalcParser.exp_base_return retval = new CalcParser.exp_base_return();
        retval.start = input.LT(1);


        MiArbol root_0 = null;

        Token NUMERO20=null;
        Token IDENT21=null;
        Token APARENTESIS22=null;
        Token CPARENTESIS24=null;
        CalcParser.expresion_return expresion23 =null;


        MiArbol NUMERO20_tree=null;
        MiArbol IDENT21_tree=null;
        MiArbol APARENTESIS22_tree=null;
        MiArbol CPARENTESIS24_tree=null;

        try {
            // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:9: ( ( NUMERO ) | ( IDENT ) | ( APARENTESIS ! expresion CPARENTESIS !) )
            int alt8=3;
            switch ( input.LA(1) ) {
            case NUMERO:
                {
                alt8=1;
                }
                break;
            case IDENT:
                {
                alt8=2;
                }
                break;
            case APARENTESIS:
                {
                alt8=3;
                }
                break;
            default:
                NoViableAltException nvae =
                    new NoViableAltException("", 8, 0, input);

                throw nvae;

            }

            switch (alt8) {
                case 1 :
                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:11: ( NUMERO )
                    {
                    root_0 = (MiArbol)adaptor.nil();


                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:11: ( NUMERO )
                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:12: NUMERO
                    {
                    NUMERO20=(Token)match(input,NUMERO,FOLLOW_NUMERO_in_exp_base172); 
                    NUMERO20_tree = 
                    (MiArbol)adaptor.create(NUMERO20)
                    ;
                    adaptor.addChild(root_0, NUMERO20_tree);


                    }


                    }
                    break;
                case 2 :
                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:21: ( IDENT )
                    {
                    root_0 = (MiArbol)adaptor.nil();


                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:21: ( IDENT )
                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:22: IDENT
                    {
                    IDENT21=(Token)match(input,IDENT,FOLLOW_IDENT_in_exp_base177); 
                    IDENT21_tree = 
                    (MiArbol)adaptor.create(IDENT21)
                    ;
                    adaptor.addChild(root_0, IDENT21_tree);


                    }


                    }
                    break;
                case 3 :
                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:31: ( APARENTESIS ! expresion CPARENTESIS !)
                    {
                    root_0 = (MiArbol)adaptor.nil();


                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:31: ( APARENTESIS ! expresion CPARENTESIS !)
                    // C:\\Users\\Jose\\workspace\\prac10\\src\\main\\java\\analizadores\\CalcParser.g:27:32: APARENTESIS ! expresion CPARENTESIS !
                    {
                    APARENTESIS22=(Token)match(input,APARENTESIS,FOLLOW_APARENTESIS_in_exp_base183); 

                    pushFollow(FOLLOW_expresion_in_exp_base186);
                    expresion23=expresion();

                    state._fsp--;

                    adaptor.addChild(root_0, expresion23.getTree());

                    CPARENTESIS24=(Token)match(input,CPARENTESIS,FOLLOW_CPARENTESIS_in_exp_base188); 

                    }


                    }
                    break;

            }
            retval.stop = input.LT(-1);


            retval.tree = (MiArbol)adaptor.rulePostProcessing(root_0);
            adaptor.setTokenBoundaries(retval.tree, retval.start, retval.stop);

        }
        catch (RecognitionException rre) {
          throw rre;}
         
        finally {
        	// do for sure before leaving
        }
        return retval;
    }
    // $ANTLR end "exp_base"

    // Delegated rules


 

    public static final BitSet FOLLOW_instrucciones_in_entrada77 = new BitSet(new long[]{0x0000000000020410L});
    public static final BitSet FOLLOW_EOF_in_entrada80 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_operadores_in_instrucciones98 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_asignacion_in_instrucciones100 = new BitSet(new long[]{0x0000000000200000L});
    public static final BitSet FOLLOW_SEPARADOR_in_instrucciones103 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_expresion_in_operadores110 = new BitSet(new long[]{0x0000000000040002L});
    public static final BitSet FOLLOW_OP_LOGICOS_in_operadores113 = new BitSet(new long[]{0x0000000000020410L});
    public static final BitSet FOLLOW_expresion_in_operadores115 = new BitSet(new long[]{0x0000000000040002L});
    public static final BitSet FOLLOW_IDENT_in_asignacion123 = new BitSet(new long[]{0x0000000000000800L});
    public static final BitSet FOLLOW_IGUAL_in_asignacion125 = new BitSet(new long[]{0x0000000000020410L});
    public static final BitSet FOLLOW_expresion_in_asignacion128 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_exp_mult_in_expresion134 = new BitSet(new long[]{0x0000000000012002L});
    public static final BitSet FOLLOW_MAS_in_expresion138 = new BitSet(new long[]{0x0000000000020410L});
    public static final BitSet FOLLOW_MENOS_in_expresion141 = new BitSet(new long[]{0x0000000000020410L});
    public static final BitSet FOLLOW_exp_mult_in_expresion145 = new BitSet(new long[]{0x0000000000012002L});
    public static final BitSet FOLLOW_exp_base_in_exp_mult153 = new BitSet(new long[]{0x0000000000080202L});
    public static final BitSet FOLLOW_POR_in_exp_mult157 = new BitSet(new long[]{0x0000000000020410L});
    public static final BitSet FOLLOW_ENTRE_in_exp_mult160 = new BitSet(new long[]{0x0000000000020410L});
    public static final BitSet FOLLOW_exp_base_in_exp_mult163 = new BitSet(new long[]{0x0000000000080202L});
    public static final BitSet FOLLOW_NUMERO_in_exp_base172 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_IDENT_in_exp_base177 = new BitSet(new long[]{0x0000000000000002L});
    public static final BitSet FOLLOW_APARENTESIS_in_exp_base183 = new BitSet(new long[]{0x0000000000020410L});
    public static final BitSet FOLLOW_expresion_in_exp_base186 = new BitSet(new long[]{0x0000000000000040L});
    public static final BitSet FOLLOW_CPARENTESIS_in_exp_base188 = new BitSet(new long[]{0x0000000000000002L});

}